package com.demoproject.service.impl;

import com.demoproject.dao.UserDao;
import com.demoproject.dao.impl.UserDaoImpl;
import com.demoproject.dao.impl.UserDaoMySQLImpl;
import com.demoproject.dao.impl.UserDaoOracleImpl;
import com.demoproject.service.UserService;

public class UserServiceImpl implements UserService {

//    private UserDao userDao = new UserDaoImpl();
//    private UserDao userDao = new UserDaoMySQLImpl();
//    private UserDao userDao = new UserDaoOracleImpl();

    UserDao userDao;

//    之后通过Spring的IoC继续创建对象并注入默认驱动即可，不需要代码块进行注入
//    {
//        setUserDao(new UserDaoMySQLImpl());
//    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void getUser() {
        userDao.getUser();
    }


}
